﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x020000C6 RID: 198
	public class TUseDatabase : TCustomSqlStatement
	{
		// Token: 0x0600072A RID: 1834 RVA: 0x00300361 File Offset: 0x002FE561
		public TUseDatabase(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstUseDatabase;
		}

		// Token: 0x0600072B RID: 1835 RVA: 0x00300372 File Offset: 0x002FE572
		internal override void buildsql()
		{
		}

		// Token: 0x0600072C RID: 1836 RVA: 0x00300374 File Offset: 0x002FE574
		internal override void clear()
		{
		}

		// Token: 0x0600072D RID: 1837 RVA: 0x00300376 File Offset: 0x002FE576
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x0600072E RID: 1838 RVA: 0x0030037D File Offset: 0x002FE57D
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x17000151 RID: 337
		// (get) Token: 0x0600072F RID: 1839 RVA: 0x0030037F File Offset: 0x002FE57F
		// (set) Token: 0x06000730 RID: 1840 RVA: 0x00300387 File Offset: 0x002FE587
		public virtual TObjectName DatabaseName
		{
			get
			{
				return this.databaseName;
			}
			set
			{
				this.databaseName = value;
			}
		}

		// Token: 0x06000731 RID: 1841 RVA: 0x00300390 File Offset: 0x002FE590
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TDummy tdummy = (TDummy)this.rootNode;
			base.doParseStatement(psql);
			this.databaseName = (TObjectName)tdummy.node1;
			this.databaseName.ObjectType = 22;
			this.databaseName.DbObjectType = EDbObjectType.database;
			base.DatabaseObjects.Add(this.databaseName);
			return 0;
		}

		// Token: 0x06000732 RID: 1842 RVA: 0x003003F7 File Offset: 0x002FE5F7
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000733 RID: 1843 RVA: 0x00300407 File Offset: 0x002FE607
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x040011D8 RID: 4568
		private TObjectName databaseName;
	}
}
